<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
    >
      <el-form-item label="填报时间" prop="fdTime">
        <el-date-picker
          clearable
          v-model="queryParams.fdTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择填报时间"
        >
        </el-date-picker>
      </el-form-item>

      <!-- <el-form-item label="学院" prop="college">
        <el-select v-model="queryParams.college" placeholder="请选择学院" clearable>
          <el-option
            v-for="dict in dict.type.rt_filling_college"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item> -->

      <el-form-item label="年份" prop="years">
        <el-select v-model="queryParams.years" placeholder="请选择年份" clearable>
          <el-option
            v-for="dict in dict.type.sys_teacher_kpi_filling_year"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>

      <el-form-item label="填报人" prop="fdName">
        <el-input
          v-model="queryParams.fdName"
          placeholder="请输入填报人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

     

      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >搜索</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</el-button
        >
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
        
             <el-button type="success" plain icon="el-icon-check" size="mini" :disabled="multiple" @click="checkAgree" v-hasPermi="['teacher:honor:remove']">批量通过</el-button>
             <el-button type="danger" plain icon="el-icon-check" size="mini" :disabled="multiple" @click="closeC" v-hasPermi="['teacher:honor:remove']">批量驳回</el-button>
              <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['teacher:performance:export']"
          >导出</el-button
        >
          </el-col>
      <el-col :span="1.5">
        
      </el-col>
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>

    <el-table
      v-loading="loading"
      :data="performanceList"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="学院" align="center" prop="college" />

      <el-table-column
        label="填报时间"
        align="center"
        prop="fdTime"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ scope.row.fdTime | formatDate }}</span>
        </template>
      </el-table-column>
       <el-table-column label="工号" align="center" prop="creditPass" >
      </el-table-column>
      <el-table-column label="填报人" align="center" prop="fdName" />
       <el-table-column label="年份" align="center" prop="years">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_teacher_kpi_filling_year" :value="scope.row.years"/>
        </template>
      </el-table-column>
      <!-- <el-table-column label="完成情况" align="center" prop="sucesss" /> -->
      <el-table-column label="提交状态" align="center" prop="substatus">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.sys_commit_status" :value="scope.row.substatus"/>
          </template>
        </el-table-column>
        
        
       <el-table-column label="审核状态" align="center" prop="xwstatus">
         <template slot-scope="scope">
           <el-tag type="danger" v-if="scope.row.yjstatus == 1 && scope.row.ksstatus == 2 ">科室复核驳回</el-tag>
          <!-- 审批状态（0、待审批；1、已通过； -->
          <el-tag v-else-if="scope.row.yjstatus == 0 || scope.row.yjstatus == null">待审核</el-tag>
          <el-tag type="success" v-else-if="scope.row.yjstatus == 1"
            >党支部书记审批通过</el-tag
          >
          <el-tag type="danger" v-else-if="scope.row.yjstatus == 2"
            >党支部书记审批驳回</el-tag
          >
        </template>
      </el-table-column>

      
      <!-- <el-table-column
        label="审核状态"
        align="center"
        class-name="small-padding fixed-width"
      >
      
        <template slot-scope="scope">
          <el-button
            @click="handleUpdates(scope.row)"
            v-hasPermi="['teacher:performance:edit']"
            >查看</el-button
          >

         
        </template>
      </el-table-column> -->
           
 

      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
      
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="examineFdy(scope.row)"
            v-hasPermi="['teacher:kpiFilling:edit']"
            >审批</el-button
          >
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 查看详情 -->
    <el-dialog title="查看详情" :visible.sync="dialogVisible" width="80%"  append-to-body >
      <!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> -->
      <!-- <el-form ref="form" :model="form" :rules="rules" label-width="80px"> -->

      <!-- <el-steps :active="2" align-center>
          <el-step title="学务办初审" ></el-step>
          <el-step title="党总支书记审核" ></el-step>
          <el-step title="科室复核" ></el-step>
          <el-step title="学工处长审核" ></el-step>
        </el-steps> -->
  <el-steps v-if="this.form.xwstatus == 0 || this.form.xwstatus == null " :active="0" align-center finish-status="success">
        <el-step title="学务办初审"  :description="finishStatus('xwidea')"></el-step>
        <el-step title="党总支书记审核" :description="finishStatus('yjidea')" ></el-step>
        <el-step title="科室复核" :description="finishStatus('ksidea')"></el-step>
        <el-step title="学工处长审核" :description="finishStatus('xgidea')"></el-step>
      </el-steps>

      <el-steps v-if="this.form.xwstatus == 1 && (this.form.yjstatus == null || this.form.yjstatus == 0) " :active="1" align-center finish-status="success">
        <el-step title="学务办初审" :description="finishStatus('xwidea')"></el-step>
        <el-step title="党总支书记审核" :description="finishStatus('yjidea')"></el-step>
        <el-step title="科室复核" :description="finishStatus('ksidea')"></el-step>
        <el-step title="学工处长审核" :description="finishStatus('xgidea')"></el-step>
      </el-steps>

      <el-steps v-if="this.form.xwstatus == 1 && this.form.yjstatus == 1 && (this.form.ksstatus == null || this.form.ksstatus ==  0 )" :active="2" align-center finish-status="success">
        <el-step title="学务办初审" :description="finishStatus('xwidea')"></el-step>
        <el-step title="党总支书记审核" :description="finishStatus('yjidea')"></el-step>
        <el-step title="科室复核" :description="finishStatus('ksidea')"></el-step>
        <el-step title="学工处长审核" :description="finishStatus('xgidea')"></el-step>
      </el-steps>

      <el-steps v-if="this.form.xwstatus == 1 && this.form.yjstatus == 1 && this.form.ksstatus == 1 && (this.form.xgstatus == null || this.form.xgstatus ==0 )" :active="3" align-center finish-status="success">
        <el-step title="学务办初审" :description="finishStatus('xwidea')"></el-step>
        <el-step title="党总支书记审核" :description="finishStatus('yjidea')"></el-step>
        <el-step title="科室复核" :description="finishStatus('ksidea')"></el-step>
        <el-step title="学工处长审核" :description="finishStatus('xgidea')"></el-step>
      </el-steps>


      <!-- 开始审批 -->
      <el-steps v-if="this.form.xwstatus == 1 && this.form.yjstatus == 1 && this.form.ksstatus == 1 && this.form.xgstatus == 1 " :active="4" align-center finish-status="success">
        <el-step title="学务办初审" :description="finishStatus('xwidea')"></el-step>
        <el-step title="党总支书记审核" :description="finishStatus('yjidea')"></el-step>
        <el-step title="科室复核" :description="finishStatus('ksidea')" ></el-step>
        <el-step title="学工处长审核" :description="finishStatus('xgidea')" ></el-step>
      </el-steps>


<!--  错误提示 -->
      <el-steps v-if="this.form.xwstatus == 2 && (this.form.yjstatus == null || this.form.yjstatus == 0) " :active="1" align-center finish-status="error">
        <el-step title="学务办初审" :description="finishStatus('xwidea')"></el-step>
        <el-step title="党总支书记审核" :description="finishStatus('yjidea')"></el-step>
        <el-step title="科室复核" :description="finishStatus('ksidea')"></el-step>
        <el-step title="学工处长审核" :description="finishStatus('xgidea')"></el-step>
      </el-steps>

      <el-steps v-if="this.form.xwstatus == 1 && this.form.yjstatus == 2 && (this.form.ksstatus == null ||this.form.ksstatus ==0 ) " :active="2" align-center finish-status="error">
        <el-step status="success" title="学务办初审" :description="finishStatus('xwidea')"></el-step>
        <el-step title="党总支书记审核" :description="finishStatus('yjidea')"></el-step>
        <el-step title="科室复核" :description="finishStatus('ksidea')"></el-step>
        <el-step title="学工处长审核" :description="finishStatus('xgidea')"></el-step>
      </el-steps>

      <el-steps v-if="this.form.xwstatus == 1 && this.form.yjstatus == 1 && this.form.ksstatus == 2 && (this.form.xgstatus == null || this.form.xgstatus == 0 )" :active="3" align-center finish-status="error">
        <el-step status="success" title="学务办初审" :description="finishStatus('xwidea')"></el-step>
        <el-step status="success" title="党总支书记审核" :description="finishStatus('yjidea')"></el-step>
        <el-step title="科室复核" :description="finishStatus('ksidea')"></el-step>
        <el-step title="学工处长审核" :description="finishStatus('xgidea')"></el-step>
      </el-steps>

      <!-- 学工处长驳回 -->
      <el-steps v-if="this.form.xwstatus == 2 && this.form.yjstatus == 2 && this.form.ksstatus == 2 && this.form.xgstatus == 2 " :active="4" align-center finish-status="error">
        <el-step title="学务办初审" :description="finishStatus('xwidea')"></el-step>
        <el-step title="党总支书记审核" :description="finishStatus('yjidea')"></el-step>
        <el-step title="科室复核" :description="finishStatus('ksidea')"></el-step>
        <el-step title="学工处长审核" :description="finishStatus('xgidea')"></el-step>
      </el-steps>

      <el-steps v-if="this.form.xwstatus == 1 && this.form.yjstatus == 1 && this.form.ksstatus == 2 && this.form.xgstatus == 2 " :active="4" align-center finish-status="error">
        <el-step  status="success" title="学务办初审" :description="finishStatus('xwidea')"></el-step>
        <el-step  status="success" title="党总支书记审核" :description="finishStatus('yjidea')"></el-step>
        <el-step title="科室复核" :description="finishStatus('ksidea')"></el-step>
        <el-step title="学工处长审核" :description="finishStatus('xgidea')"></el-step>
      </el-steps>

      <el-steps v-if="this.form.xwstatus == 1 && this.form.yjstatus == 2 && this.form.ksstatus == 2 && this.form.xgstatus == 2 " :active="4" align-center finish-status="error">
        <el-step  status="success" title="学务办初审" :description="finishStatus('xwidea')"></el-step>
        <el-step  title="党总支书记审核" :description="finishStatus('yjidea')"></el-step>
        <el-step  title="科室复核" :description="finishStatus('ksidea')"></el-step>
        <el-step title="学工处长审核" :description="finishStatus('xgidea')"></el-step>
      </el-steps>

      <!-- 科室驳回 1-->
      <el-steps v-if="this.form.xwstatus == 2 && this.form.yjstatus == 2 && this.form.ksstatus == 2 && (this.form.xgstatus == null || this.form.xgstatus == 0 )" :active="3" align-center finish-status="error">
        <el-step title="学务办初审" :description="finishStatus('xwidea')"></el-step>
        <el-step title="党总支书记审核" :description="finishStatus('yjidea')"></el-step>
        <el-step title="科室复核" :description="finishStatus('ksidea')"></el-step>
        <el-step title="学工处长审核" :description="finishStatus('xgidea')"></el-step>
      </el-steps>

       <!-- 科室驳回 2 -->
      <el-steps v-if="this.form.xwstatus == 1 && this.form.yjstatus == 2 && this.form.ksstatus == 2 && (this.form.xgstatus == null || this.form.xgstatus == 0 )" :active="3" align-center finish-status="error">
        <el-step status="success" title="学务办初审" :description="finishStatus('xwidea')"></el-step>
        <el-step title="党总支书记审核" :description="finishStatus('yjidea')"></el-step>
        <el-step title="科室复核" :description="finishStatus('ksidea')"></el-step>
        <el-step title="学工处长审核" :description="finishStatus('xgidea')"></el-step>
      </el-steps>

      <!-- 书记驳回 -->
      <el-steps v-if="this.form.xwstatus == 2 && this.form.yjstatus == 2 && (this.form.ksstatus == null || this.form.ksstatus == 0 )" :active="2" align-center finish-status="error">
        <el-step title="学务办初审" :description="finishStatus('xwidea')"></el-step>
        <el-step title="党总支书记审核" :description="finishStatus('yjidea')"></el-step>
        <el-step title="科室复核" :description="finishStatus('ksidea')"></el-step>
        <el-step title="学工处长审核" :description="finishStatus('xgidea')"></el-step>
      </el-steps>


      <!-- 开始审批 -->
      <el-steps v-if="this.form.xwstatus == 1 && this.form.yjstatus == 1 && this.form.ksstatus == 1 && this.form.xgstatus == 2 " :active="4" align-center finish-status="error">
        <el-step status="success" title="学务办初审" :description="finishStatus('xwidea')"></el-step>
        <el-step status="success" title="党总支书记审核" :description="finishStatus('yjidea')"></el-step>
        <el-step status="success" title="科室复核" :description="finishStatus('ksidea')"></el-step>
        <el-step title="学工处长审核" :description="finishStatus('xgidea')"></el-step>
      </el-steps>


      <div  v-if="this.form.xwstatus == 1 && (this.form.yjstatus ==0 || this.form.yjstatus == null)" style="margin: 10px 0 10px 0;text-align: right;">
        <el-button type="primary"  @click="openAuditDialog('同意')">同意</el-button>
        <el-button type="danger" @click="openAuditDialog('驳回')">驳回</el-button>
      </div>

       <div  v-if="this.form.yjstatus == 1 && this.form.ksstatus == 2 " style="margin: 10px 0 10px 0;text-align: right;">
        <el-button type="primary"  @click="openAuditDialog('同意')">同意</el-button>
        <el-button type="danger" @click="openAuditDialog('驳回')">驳回</el-button>
      </div>

      <el-tabs type="border-card" >
        <el-tab-pane label="指导学生取得第二课堂学分奖励">
            <div>
                <div>
                  <el-row :gutter="10">
                  </el-row>
                  <div style="margin-top: 20px;">
                    <el-table :data="form.passList" border>
                      <el-table-column label="序号" type="index" width="50" align="center">
                      </el-table-column>

                      <el-table-column label="第二课堂合格人数" align="center" prop="passs" />
                      <!-- <el-button type="text" @click="open1 = true">修改</el-button> -->

                      <!-- <el-table-column label="地点" align="center" prop="place" />
                      <el-table-column label="班级名称" align="center" prop="className" />
                      <el-table-column label="参与学生人数" align="center" prop="numberOfStudents" />
                      <el-table-column label="主要内容" align="center" prop="mainContent" />
                      <el-table-column label="相片" align="center" prop="photo" width="100">
                        <template slot-scope="scope">
                          <image-preview :src="scope.row.photo" :width="50" :height="50" />
                        </template>
                      </el-table-column> -->
                    </el-table>
                  </div>
                </div>
              </div>

              


        </el-tab-pane>

        <el-tab-pane label="辅导员工作室业绩">
          
           <div>
                <div>
                  <el-row :gutter="10">
                   
                  </el-row>
                  <div style="margin-top: 20px;">
                    <el-table :data="form.activeList" border>
                      <el-table-column label="序号" type="index" width="50" align="center">
                      </el-table-column>

                        <el-table-column label="活动类型" align="center" prop="activeType" />
                        <el-table-column label="时间" align="center" prop="gzsTime" width="180">
                          <template slot-scope="scope">
                            <span>{{ scope.row.gzsTime | formatDate }}</span>
                          </template>
                        </el-table-column>
                        
                        <el-table-column label="参与领导" align="center" prop="gzsParticipate" />
                        <el-table-column label="参与辅导员
                  " align="center" prop="gzsFdy" />
                        <el-table-column label="参与学生" align="center" prop="gzsStu" />
                        <el-table-column label="活动主题" align="center" prop="gzsTheme" />
                        <el-table-column label="地点" align="center" prop="gzsPlace" />
                        <el-table-column label="活动开展介绍" align="center" prop="gzsIntroduce" >
                           <template slot-scope="scope">
                                  
                              <div :title="scope.row.gzsIntroduce" style="white-space:nowrap;width:100%;text-overflow: ellipsis;overflow: hidden;">{{ scope.row.gzsIntroduce }}</div>
                            </template>
                        </el-table-column>
                        <el-table-column label="分配比例" align="center" prop="gzsProportion" />
                         <el-table-column label="新闻" align="center" prop="gzsNews" >
                           <template slot-scope="scope">
                            <image-preview :src="scope.row.gzsNews" :width="50" :height="50" />
                          </template>
                        </el-table-column>
                        <!-- <el-table-column label="图片上传" align="center" prop="gzsPicture" /> -->
                        <el-table-column label="照片" align="center" prop="gzsPicture" width="100">
                          <template slot-scope="scope">
                            <image-preview :src="scope.row.gzsPicture" :width="50" :height="50" />
                          </template>
                        </el-table-column>

                      <!-- <el-table-column label="活动类型" align="center" prop="activeType" />
                       <el-table-column label="时间" align="center" prop="gzsTime" width="180">
                          <template slot-scope="scope">
                            <span>{{ parseTime(scope.row.gzsTime, '{y}-{m}-{d}') }}</span>
                          </template>
                        </el-table-column>
                       <el-table-column label="活动主题" align="center" prop="gzsTheme" />
                       <el-table-column label="地点" align="center" prop="gzsPlace" />
                       
                        <el-table-column label="活动开展介绍" align="center" prop="gzsIntroduce" /> -->
                      <!-- <el-table-column label="地点" align="center" prop="place" />
                      <el-table-column label="班级名称" align="center" prop="className" />
                      <el-table-column label="参与学生人数" align="center" prop="numberOfStudents" />
                      <el-table-column label="主要内容" align="center" prop="mainContent" />
                      <el-table-column label="相片" align="center" prop="photo" width="100">
                        <template slot-scope="scope">
                          <image-preview :src="scope.row.photo" :width="50" :height="50" />
                        </template>
                      </el-table-column> -->
                    </el-table>
                  </div>
                </div>
                
                  <!-- <el-button type="text" @click="open2 = true">修改</el-button> -->
              </div>
              
        </el-tab-pane>
        <el-tab-pane label="承接区级、校级学生工作任务">
            <div>
                <div>
                  <el-row :gutter="10">
                  </el-row>
                  <div style="margin-top: 20px;">
                    <el-table :data="form.rwList" border>
                      <el-table-column label="序号" type="index" width="50" align="center">
                      </el-table-column>
                       <el-table-column label="活动类型" align="center" prop="rwType" />
                      <el-table-column label="时间" align="center" prop="rwTime" width="180">
                        <template slot-scope="scope">
                          <span>{{ scope.row.rwTime | formatDate }}</span>
                        </template>
                      </el-table-column>
                      <el-table-column label="参与领导" align="center" prop="rwParticipate" />
                      <el-table-column label="工作人员" align="center" prop="rwPeople" />
                      <el-table-column label="参与学生数" align="center" prop="rwStu" />
                      <el-table-column label="活动主题" align="center" prop="rwTheme" />
                      <el-table-column label="地点" align="center" prop="rwPlace" />
                      <el-table-column label="完成情况" align="center" prop="rwSituation" >
                         <template slot-scope="scope">
                                  
                              <div :title="scope.row.rwSituation" style="white-space:nowrap;width:100%;text-overflow: ellipsis;overflow: hidden;">{{ scope.row.rwSituation }}</div>
                            </template>
                      </el-table-column>
                      <el-table-column label="新闻" align="center" prop="rwNews" >
                          <template slot-scope="scope">
                          <image-preview :src="scope.row.rwNews" :width="50" :height="50" />
                        </template>
                      </el-table-column>
                      <el-table-column label="分配比例" align="center" prop="rwProportion" />

                      <el-table-column label="图片上传" align="center" prop="rwPicture" width="100">
                        <template slot-scope="scope">
                          <image-preview :src="scope.row.rwPicture" :width="50" :height="50" />
                        </template>
                      </el-table-column>
                    
                      <!-- <el-table-column label="文件" align="center" prop="rwFile" >
                           <template slot-scope="scope">
                          <el-link :href="`${baseUrl}${scope.row.rwFile}`" :underline="false" target="_blank">
                              <div :title="scope.row.rwFile" style="white-space:nowrap;width:100%;text-overflow: ellipsis;overflow: hidden;">{{ scope.row.rwFile }}</div>
                          </el-link>
                        </template>
                      </el-table-column> -->
                    </el-table>
                  </div>
                  <!-- <el-button type="text" @click="open3 = true">修改</el-button> -->
                </div>
                
                
              </div>
        </el-tab-pane>
        <el-tab-pane label="担任职务">
          <div>
                <div>
                  <el-row :gutter="10">
                  </el-row>
                  <div style="margin-top: 20px;">
                    <el-table :data="form.servingList" border>
                      <el-table-column label="序号" type="index" width="50" align="center">
                      </el-table-column>
                      <el-table-column label="职务" align="center" prop="servingPost" />
                      <el-table-column label="开始时间" align="center" prop="servingTime" width="180">
                        <template slot-scope="scope">
                          <span>{{ scope.row.servingTime | formatDate }}</span>
                        </template>
                      </el-table-column>

                      <el-table-column label="结束时间" align="center" prop="appointment" width="180">
                        <template slot-scope="scope">
                          <span>{{ scope.row.appointment | formatDate }}</span>
                        </template>
                      </el-table-column>

                        <el-table-column label="文件上传" align="center" prop="servingFile" width="100">
                        <template slot-scope="scope">
                          <el-link :href="`${baseUrl}${scope.row.servingFile}`" :underline="false" target="_blank">
                             <div :title="scope.row.servingFile" style="white-space:nowrap;width:100%;text-overflow: ellipsis;overflow: hidden;">{{ scope.row.servingFile }}</div>
                          </el-link>
                        </template>
                      </el-table-column>
                    
                    </el-table>
                  </div>
                </div>
                <!-- <el-button type="text" @click="open4 = true">修改</el-button> -->
                
              </div>

        </el-tab-pane>
        <el-tab-pane label="最大任务奖励">
           <div>
                <div>
                  <el-row :gutter="10">
                  </el-row>
                  <div style="margin-top: 20px;">
                    <el-table :data="form.taskList" border>
                      <el-table-column label="序号" type="index" width="50" align="center">
                      </el-table-column>
                      <el-table-column label="任务描述" align="center" prop="taskDescribe" />
                        <el-table-column label="开始时间" align="center" prop="taskStart" width="180" >
                         <template slot-scope="scope">
                          <span>{{ scope.row.taskStart | formatDate }}</span>
                        </template>
                      </el-table-column>
                      <el-table-column label="结束时间" align="center" prop="taskEnd" width="180" >
                        <template slot-scope="scope">
                          <span>{{ scope.row.taskEnd | formatDate }}</span>
                        </template>
                      </el-table-column>

                     
                    </el-table>
                  </div>
                </div>
                
                <!-- <el-button type="text" @click="open5 = true">修改</el-button>                 -->
              </div>
        </el-tab-pane>
      </el-tabs>
      <!-- <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div> -->
    </el-dialog>

    <!-- 添加或修改综合绩效对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
       <el-form-item label="学院" prop="college" :rules="rules.reason1">
          <el-select v-model="form.college" placeholder="请选择学院">
            <el-option
              v-for="dict in dict.type.rt_filling_college"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
              
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="提交状态" prop="substatus" :rules="rules.reason2">
          <el-select v-model="form.substatus" placeholder="请选择提交状态">
            <el-option
              v-for="dict in dict.type.sys_commit_status"
              :key="dict.value"
              :label="dict.label"
              :value="parseInt(dict.value)"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="填报时间" prop="fdTime" :rules="rules.reason3">
          <el-date-picker
            clearable
            v-model="form.fdTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择填报时间"
          >
          </el-date-picker>
        </el-form-item>

         <el-table-column label="工号" align="center" prop="creditPass" >
      </el-table-column>

        <el-form-item label="填报人" prop="fdName" :rules="rules.reason4">
          <el-input v-model="form.fdName" placeholder="请输入填报人" />
        </el-form-item>
       <el-form-item label="年份" prop="years" :rules="rules.reason5">
          <el-select v-model="form.years" placeholder="请选择年份">
            <el-option
              v-for="dict in dict.type.sys_teacher_kpi_filling_year"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>

        
     
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 第二课堂学分奖励 -->
     <!-- 添加或修改综合绩效对话框 -->
    <el-dialog title="第二课堂信息修改" :visible.sync="open1" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="160px">
       
        <el-form-item label="第二课堂合格人数" prop="creditPass">
          <el-input v-model="form.creditPass" placeholder="请输入第二课堂合格人数" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFormOne">确 定</el-button>
        <el-button @click="cancelOne">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 辅导员工作室弹框 -->
     <el-dialog :title="title" :visible.sync="open2" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">

          <el-form-item label="活动类型" prop="activeType" :rules="rules.reason1">
          <el-input v-model="form.activeType" placeholder="请输入活动类型" />
        </el-form-item>


        <el-form-item label="时间" prop="gzsTime" :rules="rules.reason2">
          <el-date-picker clearable
            v-model="form.gzsTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择工作室时间">
          </el-date-picker>
        </el-form-item>
       
        <el-form-item label="参与领导" prop="gzsParticipate" :rules="rules.reason3">
          <el-input v-model="form.gzsParticipate" placeholder="请输入参与领导" />
        </el-form-item>
        <el-form-item label="参与辅导员
" prop="gzsFdy" :rules="rules.reason4">
          <el-input v-model="form.gzsFdy" placeholder="请输入参与辅导员
" />
        </el-form-item>
        <el-form-item label="参与学生" prop="gzsStu" :rules="rules.reason5">
          <el-input v-model="form.gzsStu" placeholder="请输入参与学生" />
        </el-form-item>
        <el-form-item label="活动主题" prop="gzsTheme" :rules="rules.reason6">
          <el-input v-model="form.gzsTheme" placeholder="请输入活动主题" />
        </el-form-item>

         <el-form-item label="地点" prop="gzsPlace" :rules="rules.reason7">
          <el-input v-model="form.gzsPlace" placeholder="请输入工作室地点" />
        </el-form-item>

        <el-form-item label="活动开展介绍" prop="gzsIntroduce" :rules="rules.reason8">
          <el-input v-model="form.gzsIntroduce" placeholder="请输入活动开展介绍" />
        </el-form-item>
        
        
        <el-form-item label="分配比例" prop="gzsProportion" :rules="rules.reason9">
          <el-input v-model="form.gzsProportion" placeholder="请输入分配比例" />
        </el-form-item>
        <el-form-item label="新闻" prop="gzsNews" :rules="rules.reason10">
          <el-input v-model="form.gzsNews" placeholder="请输入新闻" />
        </el-form-item>

        <el-form-item label="照片" prop="gzsPicture" :rules="rules.reason11">
          <image-upload v-model="form.gzsPicture" />
        </el-form-item>
        
      
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFormTwp">确 定</el-button>
        <el-button @click="cancelTwo">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 承接任务弹框 -->
      <el-dialog :title="title" :visible.sync="open3" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">

        
        <el-form-item label="活动类型" prop="rwType" :rules="rules.reason1">
          <el-input v-model="form.rwType" placeholder="活动类型" />
        </el-form-item>

        <el-form-item label="时间" prop="rwTime" :rules="rules.reason2">
          <el-date-picker clearable
            v-model="form.rwTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择时间">
          </el-date-picker>
        </el-form-item>
        
        <el-form-item label="参与领导" prop="rwParticipate" :rules="rules.reason3">
          <el-input v-model="form.rwParticipate" placeholder="请输入参与领导" />
        </el-form-item>
        <el-form-item label="工作人员" prop="rwPeople" :rules="rules.reason4">
          <el-input v-model="form.rwPeople" placeholder="请输入工作人员" />
        </el-form-item>

         <el-form-item label="参与学生" prop="rwStu" :rules="rules.reason5">
          <el-input v-model="form.rwStu" placeholder="请输入参与学生" />
        </el-form-item>

        <el-form-item label="活动主题" prop="rwTheme" :rules="rules.reason6">
          <el-input v-model="form.rwTheme" placeholder="请输入活动主题" />
        </el-form-item>

        <el-form-item label="地点" prop="rwPlace" :rules="rules.reason7">
          <el-input v-model="form.rwPlace" placeholder="请输入地点" />
        </el-form-item>

        <el-form-item label="内容及完成情况" prop="rwSituation" :rules="rules.reason8">
          <el-input v-model="form.rwSituation" placeholder="请输入完成情况" />
        </el-form-item>

          <el-form-item label="新闻" prop="rwNews" :rules="rules.reason9">
          <el-input v-model="form.rwNews" placeholder="请输入新闻" />
        </el-form-item>

        <el-form-item label="分配比例" prop="rwProportion" :rules="rules.reason10">
          <el-input v-model="form.rwProportion" placeholder="请输入分配比例" />
        </el-form-item>

        <el-form-item label="图片上传" prop="rwPicture" :rules="rules.reason11">
          <image-upload v-model="form.rwPicture" />
        </el-form-item>

         <el-form-item label="文件" prop="rwFile" :rules="rules.reason12">
          <file-upload v-model="form.rwFile"/>
        </el-form-item>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFormThree">确 定</el-button>
        <el-button @click="cancelThree">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 担任职务 -->
     <el-dialog :title="title" :visible.sync="open4" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
      
        <el-form-item label="职务" prop="servingPost" :rules="rules.reason1">
          <el-input v-model="form.servingPost" placeholder="请输入职务" />
        </el-form-item>
        <el-form-item label="担任时间" prop="servingTime" :rules="rules.reason2">
          <el-date-picker clearable
            v-model="form.servingTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择担任时间">
          </el-date-picker>
        </el-form-item>
        
        <el-form-item label="照片" prop="servingFile" :rules="rules.reason3">
          <image-upload v-model="form.servingFile" />
        </el-form-item>
      
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFormFour">确 定</el-button>
        <el-button @click="cancelFour">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 最大奖励 -->
     <el-dialog :title="title" :visible.sync="open5" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
       
        <el-form-item label="任务描述" prop="taskDescribe" :rules="rules.reason1">
          <el-input v-model="form.taskDescribe" placeholder="请输入任务描述" />
        </el-form-item>
        <el-form-item label="时间范围" prop="taskTime" :rules="rules.reason2">
          <!-- <el-date-picker
            v-model="form.taskTime"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            value-format="yyyy-MM-dd"
            >
          </el-date-picker> -->
           <el-input v-model="form.taskTime" placeholder="请输入时间范围" />


         
        </el-form-item>
       
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFormFive">确 定</el-button>
        <el-button @click="cancelFive">取 消</el-button>
      </div>
    </el-dialog>

   
    <!-- 审批意见查看 -->
    <el-dialog title="审核意见查看" :visible.sync="open6" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="150px">
            <!-- 学务处初审 -->
          <el-tag type="info">学务处初审</el-tag>
        
           <el-form-item label="是否通过" prop="xwstatus"  >
          <!-- <el-input v-model="form.xgstatus" placeholder="1 通过  2驳回" /> -->
          <el-select v-model="form.xwstatus" clearable placeholder="等待审批"  :disabled="true">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="备注" prop="xwidea" >
          <el-input v-model="form.xwidea"  :disabled="true" />
        </el-form-item>
        <br>
         <!-- 党总支书记审批 -->
        <el-tag type="info">党总支书记审批</el-tag>
         <el-form-item label="是否通过" prop="yjstatus" >
          <!-- <el-input v-model="form.xgstatus" placeholder="1 通过  2驳回" /> -->
          <el-select v-model="form.yjstatus" clearable placeholder="等待审批" :disabled="true">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="备注" prop="yjidea" >
          <el-input v-model="form.yjidea"  :disabled="true"/>
        </el-form-item>

         <!-- 科室复核 -->
         <el-tag type="info">科室复核</el-tag>
         <el-form-item label="是否通过" prop="ksstatus" >
          <!-- <el-input v-model="form.xgstatus" placeholder="1 通过  2驳回" /> -->
          <el-select v-model="form.ksstatus" clearable placeholder="等待审批" :disabled="true">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="备注" prop="ksidea" >
          <el-input v-model="form.ksidea"   :disabled="true"/>
        </el-form-item>

        <!-- 学工处长审核 -->
         <el-tag type="info">学工处长审核</el-tag>
         <el-form-item label="是否通过" prop="xgstatus" >
          <!-- <el-input v-model="form.xgstatus" placeholder="1 通过  2驳回" /> -->
          <el-select v-model="form.xgstatus" clearable placeholder="等待审批" :disabled="true">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="备注" prop="xgidea" >
          <el-input v-model="form.xgidea"   :disabled="true"/>
        </el-form-item>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="cancelSix">关 闭</el-button>
      </div>
    </el-dialog>

    <!-- 审核对话框对话框 -->
    <el-dialog title="审核意见" :visible.sync="auditOpen" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="意见" prop="yjidea">
          <el-input v-model="form.yjidea" placeholder="请输入意见" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitAudit">确 定</el-button>
        <el-button @click="auditOpen = false">取 消</el-button>
      </div>
    </el-dialog>

     <!-- 审核对话框对话框 -->
    <el-dialog title="审核意见" :visible.sync="auditOpen" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="意见" prop="yjidea">
          <el-input v-model="form.yjidea" placeholder="请输入意见" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitAudit">确 定</el-button>
        <el-button @click="auditOpen = false">取 消</el-button>
      </div>
    </el-dialog>


     <!-- 12月开放对话框 -->
		<el-dialog title="功能未开放" :visible.sync="open" width="500px" append-to-body>
			本功能只在12月开放！
			<div slot="footer" class="dialog-footer">
				
				<el-button @click="close">确 定</el-button>
			</div>
		</el-dialog>

      <!-- 批量审核意见 -->
     <el-dialog title="审核意见" :visible.sync="reason" width="500px" append-to-body>
        <el-form ref="form" :model="form" :rules="rules" label-width="80px">
          <el-form-item label="意见" prop="yjidea">
            <el-input v-model="yjidea" placeholder="请输入意见" />
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="checkUnAgree">确 定</el-button>
          <el-button @click="cancelBo">取 消</el-button>
        </div>
    </el-dialog>


  </div>
</template>

<script>
import {
  listPerformance,
  getPerformance,
  delPerformance,
  addPerformance,
  updatePerformance,
} from "@/api/teacher/performance";
// import studentManagement from '../performance/components/studentManagement/studentManagement.vue'
import { getUserProfile } from "@/api/system/user"; // 获取当前用户接口
export default {
  name: "Performance",
  dicts: ['rt_filling_college', 'sys_commit_status', 'sys_teacher_kpi_filling_year'],
  // components: { studentManagement },
  data() {
    return {
      baseUrl:process.env.VUE_APP_BASE_API,
        // 选择器
      options: [
        {
          value: 0,
          label: "待审核",
        },
        {
          value: 1,
          label: "通过",
        },
        {
          value: 2,
          label: "驳回",
        },
      ],
        // 对话框
      reason:false,
      // 查看审核
      open6:false,
      // 最大奖励
      open5:false,
      // 担任职务
      open4:false,
      // 承接任务
      open3:false,
      // 辅导员工作室
      open2:false,
      // 第二课堂弹框
      open1:false,
      check:[],
      dialogVisible: false,
      isShow: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
     yjidea: null,


      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 综合绩效表格数据
      performanceList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        fdTime: null,
        creditPass: null,
        yjstatus: null,
        yjidea: null,
        xgstatus: null,
        xgidea: null,
        servingPost: null,
        servingTime: null,
        servingFile: null,
        taskDescribe: null,
        taskTime: null,
        college: null,
        fdName: null,
        activeType: null,
        gzsTime: null,
        gzsPlace: null,
        gzsParticipate: null,
        gzsFdy: null,
        gzsStu: null,
        gzsTheme: null,
        gzsIntroduce: null,
        gzsPicture: null,
        gzsNews: null,
        gzsProportion: null,
        rwType: null,
        rwTime: null,
        rwPlace: null,
        rwParticipate: null,
        rwPeople: null,
        rwTheme: null,
        rwSituation: null,
        rwStu: null,
        rwProportion: null,
        rwFile: null,
        rwNews: null,
        rwPicture: null,
        years:  new Date().getFullYear(),
        sucesss: null,
        substatus: null,
        shstatus: null,
        xwstatus: null,
        xwidea: null,
        ksstatus: null,
        ksidea: null
      },
      activeL:null,
      agreeLists:null,
      // 表单参数
      form: {},
      // 审核标题
      auditTilte: null,
      auditOpen: false,
      roleGroup: null,
       // 审核标题
      auditTilte: null,
      auditOpen: false,
      // 表单校验
      rules: {
         reason1: [{ required: true, message: "学院", trigger: "blur" }],
         reason2: [{ required: true, message: "提交状态", trigger: "blur" }],
         reason3: [{ required: true, message: "填报时间", trigger: "blur" }],
         reason4: [{ required: true, message: "填报人", trigger: "blur" }],
         reason5: [{ required: true, message: "年份", trigger: "blur" }],
      },
    };
  },
  created() {
    	// var month = new Date().getMonth() + 1;
			// if(month!=12){
			// 	this.open=true;
			// }
			// else{
      
      //根据用户所在学院显示信息 
    this.getUser();
    // this.getList();
          // }
  },
  methods: {
    finishStatus( opinionField) {
        return this.form.xwstatus === 1 ? `审核意见：${this.form[opinionField] || '暂无填写'}` : `审核意见：${this.form[opinionField] || '暂无填写'}`;
    },
     closeC(row){
        this.id = row.id || this.ids;
				// this.id = row.id || this.ids;
				this.reason=true;
			},
    close(){
				this.$router.go(-1);
			},

    // 批量审核通过
    checkAgree(row) {
				let c = this;
				const id = row.id || this.ids;
				let person = this.fdName;


          this.$modal.confirm('是否批量审批"' + id + '"数据通过？ ').then(function() {
            if (id.length != undefined) { //批量
            // console.log("111")
              let checks;
              for (let index = 0; index < c.agreeLists.length; index++) {
                  c.agreeLists[index].yjstatus = 1;
                  c.agreeLists[index].ksstatus = 0
                  c.agreeLists[index].shstatus = 0;
                  c.agreeLists[index].fdName = person;
                   if(c.agreeLists[index].activeType==null){
                        c.agreeLists[index].activeType = c.activeL.userName;
                        // console.log(c.agreeLists[index].activeType + "123");
                        //  console.log("1");
                      }else{
                        c.agreeLists[index].activeType = c.agreeLists[index].activeType  + "," + c.activeL.userName;
                      //  console.log("2");
                      }
                      console.log(c.agreeLists[index])
                            
                updatePerformance(c.agreeLists[index]).then(response => {
                  
                  
                // });
                 });
              }
              c.getList();
              c.$modal.msgSuccess("审核通过");

              // getPerformance(id).then(response => {
              //   checks = response.data;
              //   checks.yjstatus = 1;
              //   checks.ksstatus = 0
              //   checks.shstatus = 0;
              //   checks.fdName = person;
                
                // console.log("11")
              //  getUserProfile().then(response => {
              //     if(checks.activeType==null){
              //           checks.activeType = response.data.userName;
              //           console.log(checks.activeType + "123");
              //           //  console.log("1");
              //         }else{
              //           checks.activeType = checks.activeType  + "," + response.data.userName;
              //         //  console.log("2");
              //         }
               

              // });
            } 
          }).then(() => {
        
          }).catch(() => {});
        
			},

      	// checks = response.data;
				// 			checks.yjstatus = 2;
        //       checks.shstatus = 2
				// 			checks.fdName = person;
        //       checks.yjidea = c.yjidea;

      // 批量驳回
      checkUnAgree() {
				let c = this;
				const id = this.id
				let person = this.fdName;
				this.$modal.confirm('是否一键审批"' + id + '"数据 ').then(function() {
				 if (id.length != undefined) { //批量
            // console.log("111")
              let checks;
              for (let index = 0; index < c.agreeLists.length; index++) {
                  c.agreeLists[index].yjstatus = 2;
                  c.agreeLists[index].shstatus = 2;
                  c.agreeLists[index].fdName = person;
                  c.agreeLists[index].yjidea = c.yjidea;
                   if(c.agreeLists[index].activeType==null){
                        c.agreeLists[index].activeType = c.activeL.userName;
                        // console.log(c.agreeLists[index].activeType + "123");
                        //  console.log("1");
                      }else{
                        c.agreeLists[index].activeType = c.agreeLists[index].activeType  + "," + c.activeL.userName;
                      //  console.log("2");
                      }
                      console.log(c.agreeLists[index])
                            
                updatePerformance(c.agreeLists[index]).then(response => {
                  
                  
                // });
                 });
              }
              c.getList();
              c.$modal.msgSuccess("审核已驳回");
          }
          c.reason =false;
				}).then(() => {
			
				}).catch(() => {});
			},


       // 获取当前登录信息
    getUser() {
      this.loading = true;
      getUserProfile().then(response => {
        // this.user = response.data;
        this.roleGroup = response.roleGroup;
        this.activeL = response.data
        // this.postGroup = response.postGroup;     
        // console.log(response);
        if (response.roleGroup.includes('书记')) {
          this.queryParams.college = response.data.dept.deptName
          this.departmentName = response.data.dept.deptName
          this.queryParams.xwstatus = 1;
          this.getList();
          return
        }
        this.loading = false;
        // this.getList();
      });
    },
    // 审核成功
    openAuditDialog(title) {
      this.auditTilte = title
      this.auditOpen = true
    },
    submitAudit() {
       getUserProfile().then(response => {
      if(this.form.activeType==null){
						this.form.activeType = response.data.userName;
            //  console.log(this.form.activeType);
            //  console.log("1");
					}else{
						this.form.activeType = this.form.activeType  + "," + response.data.userName;
          //  console.log("2");
					}
          
      if (this.auditTilte === '同意') {
         this.form.yjstatus = 1
         this.form.ksstatus = 0
         this.form.shstatus = 0
        updatePerformance(this.form).then(response => {
        this.$modal.msgSuccess("审核成功");
        this.auditOpen = false;
        this.dialogVisible =false;
        this.getList();
      });
      }
      if (this.auditTilte === '驳回') {
        this.form.yjstatus = 2
        this.form.substatus = 0
        this.form.shstatus = 2
        updatePerformance(this.form).then(response => {
        this.$modal.msgSuccess("审核已驳回");
        this.auditOpen = false;
        this.dialogVisible =false;
        this.getList();
      });
      }
      });
    },
  

    handleClose(done) {
      this.$confirm("确认关闭？")
        .then((_) => {
          done();
        })
        .catch((_) => {});
    },
    /** 查询综合绩效列表 */
    getList() {
      this.loading = true;
      listPerformance(this.queryParams).then((response) => {
        this.performanceList = response.rows;
        this.total = response.total;
        this.loading = false;
        this.activeList =  this.performanceList[0].activeList[0]

        // console.log(this.activeList)
        console.log(this.performanceList)
        
      });
    },

    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 第二课堂取消
    cancelOne() {
      this.open1 = false;
      this.reset();
    },
    // 辅导员绩效取消
     cancelTwo() {
      this.open2 = false;
      this.reset();
    },
    // 承接任务取消
     cancelThree() {
      this.open3 = false;
      this.reset();
    },
    // 担任职务
     cancelFour() {
      this.open4 = false;
      this.reset();
    },
    // 最大奖励
      cancelFive() {
      this.open5 = false;
      this.reset();
    },
    // 审核查看
      cancelSix() {
      this.open6 = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        fdTime: null,
        creditPass: null,
        yjstatus: null,
        yjidea: null,
        xgstatus: null,
        xgidea: null,
        servingPost: null,
        servingTime: null,
        servingFile: null,
        taskDescribe: null,
        taskTime: null,
        college: null,
        fdName: null,
        activeType: null,
        gzsTime: null,
        gzsPlace: null,
        gzsParticipate: null,
        gzsFdy: null,
        gzsStu: null,
        gzsTheme: null,
        gzsIntroduce: null,
        gzsPicture: null,
        gzsNews: null,
        gzsProportion: null,
        rwType: null,
        rwTime: null,
        rwPlace: null,
        rwParticipate: null,
        rwPeople: null,
        rwTheme: null,
        rwSituation: null,
        rwStu: null,
        rwProportion: null,
        rwFile: null,
        rwNews: null,
        rwPicture: null,
        years: null,
        sucesss: null,
        substatus: null,
        shstatus: null,
        xwstatus: null,
        xwidea: null,
        ksstatus: null,
        ksidea: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
      this.agreeLists = selection
      console.log(this.agreeLists)
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加综合绩效";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids;
      getPerformance(id).then((response) => {
        this.form = response.data;
        this.open = true;
        this.title = "修改填报信息";
      });
    },


    /** 修改按钮操作 */
    handleUpdates(row) {
      this.reset();
      const id = row.id || this.ids;
      getPerformance(id).then((response) => {
        this.form = response.data;
        this.open6 = true;
        this.title = "修改填报信息";
      });
    },
    examineFdy(row) {
      this.$modal.loading("正在努力加载中，请稍等。。。");
      this.reset();
      const id = row.id || this.ids;
      getPerformance(id).then((response) => {
        this.form = response.data;
        this.check.push(response.data)
        this.dialogVisible = true;
        this.$modal.closeLoading();

      });
    },


    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.id != null) {
            updatePerformance(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addPerformance(this.form).then((response) => {
             if (response.code === 200) {
              this.$modal.msgSuccess("新增成功");
              this.getList();
             }
             this.open = false;
            });
          }
        }
      });
    },
    // 第二课堂弹框信息提交
     submitFormOne() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.id != null) {
            updatePerformance(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open1 = false;
              this.getList();
            });
          } else {
            addPerformance(this.form).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open1 = false;
              this.getList();
            });
          }
        }
      });
    },
    // 辅导员绩效工作室
     submitFormTwp() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.id != null) {
            updatePerformance(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open2 = false;
              this.getList();
            });
          } else {
            addPerformance(this.form).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open2 = false;
              this.getList();
            });
          }
        }
      });
    },
    // 承接任务
     submitFormThree() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.id != null) {
            updatePerformance(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open3 = false;
              this.getList();
            });
          } else {
            addPerformance(this.form).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open3 = false;
              this.getList();
            });
          }
        }
      });
    },
    // 担任职务
    submitFormFour() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.id != null) {
            updatePerformance(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open4 = false;
              this.getList();
            });
          } else {
            addPerformance(this.form).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open4 = false;
              this.getList();
            });
          }
        }
      });
    },
    // 最大奖励
    submitFormFive() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.id != null) {
            updatePerformance(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open5 = false;
              this.getList();
            });
          } else {
            addPerformance(this.form).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open5 = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal
        .confirm('是否确认删除综合绩效编号为"' + ids + '"的数据项？')
        .then(function () {
          return delPerformance(ids);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download(
        "teacher/performance/export",
        {
          ...this.queryParams,
        },
        `综合绩效-填报信息_${new Date().getTime()}.xlsx`
      );
    },
  },
};
</script>
